from enum import Enum,IntEnum

class E_ActionResult(IntEnum):
    SUCCESS = 0
    FAILURE = 1
    RUNNING = 2
    ABORTED = 3
    ERROR = 4
    INVALID = 5
    UNDEFINED = 6

class Node:
    def execute(self):
        raise NotImplementedError

class ActionNode(Node):
    def execute(self):
        print("Executing Action")
        return E_ActionResult.RUNNING

class ConditionNode(Node):
    def execute(self):
        print("Evaluating Condition")
        return E_ActionResult.RUNNING

class SequenceNode(Node):
    def __init__(self, nodes):
        self.nodes = nodes

    def execute(self):
        for node in self.nodes:
            result = node.execute()
            if result != E_ActionResult.RUNNING:
                return result
        return "SUCCESS"

# 构建行为树
action = ActionNode()
condition = ConditionNode()
sequence = SequenceNode([condition, action])

# 执行行为树
result = sequence.execute()
print("Behavior Tree Result:", result)
'''
Evaluating Condition
Executing Action
Behavior Tree Result: SUCCESS
'''